/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package BLL;

import DAL.DALProvider;
import DTO.DTOProvider;
import java.util.ArrayList;

/**
 *
 * @author Pham
 */
public class BLLProvider {
    DALProvider dalProvider;
    
    public BLLProvider()
    {
        dalProvider = new DALProvider();
    }
    
    //method get all the providers
    public ArrayList<DTOProvider> getAllProvider()
    {
        return dalProvider.getAllProviders();
    }
    
    //method insert new provider
    public boolean insertProvider(DTOProvider dtoProvider)
    {
        return dalProvider.insertProvider(dtoProvider);
    }
    
    //method update provider
    public boolean updateProvider(DTOProvider dtoProvider)
    {
        return dalProvider.updateProvider(dtoProvider);
    }
    
    //method get provider by id
    public DTOProvider getProviderById(int id)
    {
        return dalProvider.getProviderByID(id);
    }
    
    //method delete provider
    public boolean deleteProvider(int id)
    {
        return dalProvider.deleteProvider(id);
    }
}
